<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="app" tagdir="/WEB-INF/tags"%>
<app:page>
      <div class="play">
    <p id="text1" class="lead">
      <span id="text1a"></span>
    </p>
    <p id="text2" class="lead">
      <span id="text2a" class="yes"></span>
      <span id="text2b" class="no"></span>
    </p>
    <nav class="navbar navbar-default navbar-fixed-bottom" role="navigation">
      <div class="container">
      <form action="${pageContext.request.contextPath}/play" method="post">
        <input type="hidden" name="poolId" value="${param.poolId}" />
        <%--
        <div id="feedback" class="btn-group btn-group-lg">
          <button type="submit" name="submit1" value="ok" class="btn btn-default">Ok</button>
          <button type="submit" name="submit1" value="ko" class="btn btn-default">Ko</button>
        </div>
        --%>
        <div id="feedback" class="btn-group btn-group-justified">
          <a class="btn btn-default btn-success" role="button">OK</a>
          <a class="btn btn-default btn-danger" role="button">KO</a>
        </div>
      </form>
      </div>
    </nav>
    </div>
    <script type="text/javascript">
var session = {
  position: ${session.position},
  entries: [
        <c:forEach var="entry" items="${session.entries}" varStatus="status">
    {
        id: ${entry.id},
        text1: "${entry.text1}",
        text2: "${entry.text2}",
        created: ${entry.created}
    }${!status.last ? ',' : ''}
        </c:forEach>
  ],
  entryCount: ${session.entryCount},
  shots: [
        <c:forEach var="shot" items="${session.shots}" varStatus="status">
    {
        id: ${shot.id},
        entryId: ${shot.entryId},
        position: ${shot.position},
        trend: ${shot.trend},
        created: ${shot.created}
    }${!status.last ? ',' : ''}
        </c:forEach>
  ],
  lastShotCreated: ${session.lastShotCreated}<c:if test="${!empty(session.lastShotEntry)}">,
  lastShotEntry: {
      id: ${session.lastShotEntry.id},
      text1: "${session.lastShotEntry.text1}",
      text2: "${session.lastShotEntry.text2}",
      created: ${session.lastShotEntry.created}
  }</c:if>
};
    </script>
</app:page>
